<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-cf">群发消息列表</div>
                </div>
				<div class="tips am-margin-bottom-sm am-u-sm-12">
					<div class="pre-info">
						<p> 每日可群发100次，但是用户每月只能接收4条。</p>
					</div>
				</div>
                <div class="widget-body am-fr">
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                        <div class="am-form-group">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-sm">
                                    <a class="am-btn am-btn-primary am-radius"
                                       href="{:url('wechat.send/add')}">
                                        <span class="am-icon-plus"></span> 新增
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="am-scrollable-horizontal am-u-sm-12">
                        <table width="100%" class="am-table am-table-hover tpl-table-black">
                            <thead>
                            <tr>
                                <th>消息编号</th>
                                <th>任务ID</th>
                                <th>消息标题</th>
                                <th>消息类型</th>
                                <th>群发状态</th>
                                <th>群发人数</th>
                                <th>成功人数</th>
                                <th>添加时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {if !$list->isEmpty()}
                                {foreach $list as $item}
                                <tr>
                                    <td class="am-text-middle">{$item['wechat_batch_send_id']}</td>
                                    <td class="am-text-middle">{$item['msg_id']?$item['msg_id']:'--'}</td>
                                    <td class="am-text-middle">
                                        <p class="item-title">{$item['title']}</p>
                                    </td>
                                    <td class="am-text-middle">{$item['msg_type']['text']}</td>
                                    <td class="am-text-middle">
                                            <span class="{$item['status']['value']<40?'x-color-green':'x-color-red'}">
                                            {$item['status']['text']}
                                            </span>
                                    </td>
                                    <td class="am-text-middle">{$item['fans_count']>0?$item['fans_count']:'--'}</td>
                                    <td class="am-text-middle">{$item['send_count']>0?$item['send_count']:'--'}</td>
                                    <td class="am-text-middle">{$item['create_time']}</td>
                                    <td class="am-text-middle">
                                        <div class="tpl-table-black-operation">
											<a href="javascript:;" class="item-send tpl-table-black-operation-green"
                                               data-id="{$item['wechat_batch_send_id']}">
                                                <i class="am-icon-send"></i> 群发
                                            </a>
                                            <a href="{:url('wechat.send/edit',['id' => $item['wechat_batch_send_id']])}">
                                                <i class="am-icon-pencil"></i> 编辑
                                            </a>
                                            <a href="javascript:;" class="item-del tpl-table-black-operation-del"
                                               data-id="{$item['wechat_batch_send_id']}">
                                                <i class="am-icon-trash"></i> 删除
                                            </a>
                                        </div>
                                    </td>
                                </tr>
                                {/foreach}
                            {else /}
                                <tr>
                                    <td colspan="9" class="am-text-center">暂无记录</td>
                                </tr>
                            {/if}
                            </tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">
                        <div class="am-fr">{:$list->render()} </div>
                        <div class="am-fr pagination-total am-margin-right">
                            <div class="am-vertical-align-middle">总记录：{:$list->total()}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {

        // 删除
        $('.item-del').del('id', "{:url('wechat.send/delete')}");
		
		// 群发
        $('.item-send').del('id', "{:url('wechat.send/status')}",'确定要进行群发？');

    });
</script>

